function sms() {
	var o = this;
	var _smsUrl = "/sys/sms.ashx?t=smscode";
	var rex_mobile =
		/^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(18[0-9]{1})|(19[0-9]{1}))+\d{8})$/;
	var rex_vcode = /^[0-9]+$/;
	this.isSubmit = 1;
	this.mobileInitInfo = "杈撳叆11浣嶆暟鎵嬫満鍙�";
	this.vcodeInitInfo = "鐭俊楠岃瘉鐮�";
	this.init = function() {
		return o
	};
	this.userVerifySubmit = function(fn) {
		o.loadVerify("楠岃瘉鎻愪氦", "璇锋斁蹇冿紝鎵嬫満鍙风爜缁濆淇濆瘑锛屼粎鐢ㄤ簬鐧诲綍/鎵惧洖瀵嗙爜", "鎻愪氦楠岃瘉", "", 0, 2, fn)
	};
	this.userRegVerifySubmit = function(fn) {
		o.loadVerify("楠岃瘉鎻愪氦", "璇锋斁蹇冿紝鎵嬫満鍙风爜缁濆淇濆瘑锛屼粎鐢ㄤ簬鐧诲綍/鎵惧洖瀵嗙爜", "鎻愪氦楠岃瘉", "", 0, 6, fn)
	};
	this.drVerifySubmit = function(fn) {
		o.loadVerify("楠岃瘉鎻愪氦", "璇疯緭鍏ュ挩璇笟鍔＄殑鎵嬫満锛岃鎵嬫満杩樺彲鐢ㄤ簬鐧诲綍銆佹壘鍥炲瘑鐮�", "鎻愪氦楠岃瘉", "", 0, 5, fn)
	};
	this.bindMobile = function(initMobile, roleId, fn) {
		o.loadVerify("鎵嬫満缁戝畾鍒拌处鍙�", roleId == 3 ? "璇锋斁蹇冿紝鎵嬫満鍙风爜缁濆淇濆瘑锛屼粎鐢ㄤ簬鐧诲綍/鎵惧洖瀵嗙爜" :
			"璇风粦瀹氬挩璇笟鍔＄殑鎵嬫満锛岃鎵嬫満鍙敤浜庣櫥褰曘€佹壘鍥炲瘑鐮�", "鎻愪氦缁戝畾", initMobile, 0, 3, fn)
	};
	this.userVerifyLogin = function(typeId, mobile, uid, fn) {
		o.loadVerify(typeId == 8 ? "鐧诲綍瀹夊叏楠岃瘉" : "鐧诲綍瀹夊叏楠岃瘉", "涓轰繚闅滄偍鐨勮处鍙峰畨鍏ㄨ杩涜鐧诲綍瀹夊叏楠岃瘉", "鐧诲綍楠岃瘉", mobile, uid, 4, fn)
	};
	this.loadVerify = function(tit, info, btntxt, initMobile, uid, typeId, fn) {
		var shtml = '<ul id="m-vcode">';
		shtml += '<li class="tit">' + info + "</li>";
		if (typeId == 4) {
			shtml += '<li class="item"><i class="txt">鎵嬫満鍙凤細</i><i class="showtxt">' + initMobile +
				'</i><input id="clt_moblieverity" name="clt_moblieverity" type="hidden" /><br class="clear" /></li>'
		} else {
			shtml +=
				'<li class="item"><i class="txt">鎵嬫満鍙凤細</i><input id="clt_moblieverity" name="clt_moblieverity" type="text" maxlength="11" /><br class="clear" /></li>'
		}
		shtml +=
			'<li class="item"><i class="txt">楠岃瘉鐮侊細</i><input id="clt_mobliecode" name="clt_mobliecode" type="text" maxlength="6" /><a href="javascript:void(0);" class="send">鍙戦€侀獙璇佺爜</a><br class="clear" /></li>';
		shtml += "</ul>";
		$.jfn(tit, shtml, btntxt, 680, function() {
			var _moblieverity = $("#clt_moblieverity");
			var _mobliecode = $("#clt_mobliecode");
			var m = _moblieverity.val();
			var v = _mobliecode.val();
			if (m == "") {
				_moblieverity.focus()
			} else {
				if (m.length != 11 || !rex_mobile.test(m)) {
					o.jalert("璇疯緭鍏ユ湁鏁堢殑鎵嬫満鍙风爜", _moblieverity)
				} else {
					if (v == "") {
						_mobliecode.focus()
					} else {
						if (v.length != 6 || !rex_vcode.test(v)) {
							o.jalert("璇疯緭鍏ユ湁鏁堟墜鏈虹煭淇￠獙璇佺爜锛�6浣嶆暟瀛楋級", _mobliecode)
						} else {
							fn.call(this, m, v)
						}
					}
				}
			}
		});
		var clt_moblieverity = $("#clt_moblieverity");
		var clt_mobliecode = $("#clt_mobliecode");
		clt_moblieverity.val(initMobile.length == 11 && rex_mobile.test(initMobile) ? initMobile : o.mobileInitInfo).css(
			"color", "#D8D8D8").focus(function() {
			var _this = $(this);
			if (_this.val() == o.mobileInitInfo) {
				_this.val("")
			}
			_this.css("color", "#000000")
		}).blur(function() {
			var _this = $(this);
			if (_this.val() == "") {
				_this.css("color", "#D8D8D8").val(o.mobileInitInfo)
			}
		});
		clt_mobliecode.val(o.vcodeInitInfo).css("color", "#D8D8D8").focus(function() {
			var _this = $(this);
			if (_this.val() == o.vcodeInitInfo) {
				_this.val("")
			}
			_this.css("color", "#000000")
		}).blur(function() {
			var _this = $(this);
			if (_this.val() == "") {
				_this.css("color", "#D8D8D8").val(o.vcodeInitInfo)
			}
		});
		$("#m-vcode>.item>.send").click(function() {
			o.send(this, clt_moblieverity, clt_mobliecode, uid, typeId)
		})
	};
	this.loginMobile = function() {
		$("#login-r>.in1>.send").click(function() {
			$("#dynpwd").focus();
			o.send(this, $("#mobile"), $("#dynpwd"), 0, 7)
		})
	};
	this.loadRegFirstMobile = function(btn) {
		btn.click(function() {
			var rex_pwd = /^(?=.{6,20}$)(?=.*[a-zA-Z]+)(?=.*[0-9]+)[a-zA-Z0-9]+$/;
			var mobile = $("#mobile");
			var password = $("#password");
			var dynpwd = $("#dynpwd");
			var _mobile = mobile.val();
			var _dynpwd = dynpwd.val();
			var _password = password.val();
			if (_mobile.length != 11 || !rex_mobile.test(_mobile)) {
				o.jalert("璇疯緭鍏ユ湁鏁堢殑鎵嬫満鍙风爜锛�11浣嶆暟锛�", mobile)
			} else {
				if (!rex_pwd.test(_password)) {
					password.val();
					o.jalert(_password == "" ? "璇峰厛璁剧疆鐧诲綍瀵嗙爜" : "鐧诲綍瀵嗙爜蹇呴』鍖呭惈瀛楁瘝鍜屾暟瀛楋紙6-20浣嶏級", password)
				} else {
					o.sendcode(this, mobile, dynpwd, 0, 8)
				}
			}
		})
	};
	this.findpwdMobile = function() {
		$("#smsform>li>.send").click(function() {
			$("#mVerifyCode").focus();
			o.send(this, $("#mobile"), $("#mVerifyCode"), 0, 7)
		})
	};
	this.sendcode = function(obj, clt_moblie, clt_code, uid, typeid) {
		if (o.isSubmit == 1) {
			var _this = $(obj);
			if (clt_moblie.length > 0) {
				var m = clt_moblie.val();
				if (m.length != 11 || !rex_mobile.test(m)) {
					o.jalert("璇疯緭鍏ユ湁鏁堢殑鎵嬫満鍙风爜锛�11浣嶆暟锛�", clt_moblie)
				} else {
					var geetest_parm0 = "";
					var geetest_parm1 = "";
					var geetest_parm2 = "";
					glb.ajax(_smsUrl, "JSON", "mobile=" + m + "&typeid=" + typeid + "&uid=" + uid + "&geetest_challenge=" +
						geetest_parm0 + "&geetest_validate=" + geetest_parm1 + "&geetest_seccode=" + geetest_parm2,
						function() {
							o.isSubmit = 0;
							_this.addClass("off")
						},
						function(data) {
							var d = eval(data);
							if (d.status == 1) {
								$.jsuccess("鍙戦€佹垚鍔�", 250, function() {
									clt_code.focus()
								}, null);
								var _time = 120;
								var _interval = null;
								var _oldTxt = _this.html();
								_this.html("<i>" + _time + "</i>绉掑悗閲嶆柊鑾峰彇");
								var n = _this.find("i");
								n.text(_time--);
								_interval = setInterval(function() {
									n.text(_time--);
									if (_time < -1) {
										if (_interval != null) {
											clearInterval(_interval)
										}
										_this.html(_oldTxt);
										_this.removeClass("off");
										o.isSubmit = 1
									}
								}, 1000)
							} else {
								_this.removeClass("off");
								o.isSubmit = 1;
								if (d.status == 2) {
									o.jalert("鍙戦€侀鐜囧お蹇簡", null)
								} else {
									if (d.status == 3) {
										o.jalert("浠婃棩鍙戦€佺殑鐭俊宸茶揪涓婇檺", null)
									} else {
										if (d.status == 4) {
											o.jalert("璇疯緭鍏ユ湁鏁堢殑鎵嬫満鍙�", clt_moblie)
										} else {
											if (d.status == 5) {
												o.jalert(typeid == 3 ? "璇ユ墜鏈哄彿涓嶈兘缁戝畾" : "璇ユ墜鏈哄彿涓嶈兘鎻愰棶", clt_moblie)
											} else {
												if (d.status == 6 || d.status == 12) {
													o.jalert("鎮ㄥ彂閫佸お棰戠箒浜�", clt_moblie)
												} else {
													if (d.status == 7) {
														o.jalert("璇ユ墜鏈哄彿宸茶绂佺敤", clt_moblie)
													} else {
														if (d.status == 8) {
															o.jalert("璇ユ墜鏈哄彿宸插浜庤处鍙风粦瀹氱姸鎬佷簡", clt_moblie)
														} else {
															if (d.status == 9 || d.status == 11) {
																o.jalert("鎵句笉鍒拌鎵嬫満鍙风粦瀹氱殑璐﹀彿", null)
															} else {
																if (d.status == 10) {
																	o.jalert("璇ユ墜鏈哄彿宸茶娉ㄥ唽锛佹偍鍙互浣跨敤璇ユ墜鏈哄彿<a href='/reg/login.html'>鐩存帴鐧诲綍</a>锛屾垨鏇存崲鎵嬫満鍙枫€�", null)
																} else {
																	if (d.status == 13) {
																		o.jalert("楠岃瘉宸茶繃鏈燂紝璇烽噸鏂版嫋鍔ㄩ獙璇�", null)
																	} else {
																		o.jalert("鎿嶄綔澶辫触,璇烽噸鏂板皾璇�", null)
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						},
						function() {
							_this.removeClass("off");
							o.isSubmit = 1;
							o.jalert("鎿嶄綔澶辫触,璇烽噸鏂板皾璇�", null)
						})
				}
			}
		}
	};
	this.send = function(obj, clt_moblie, clt_code, uid, typeid) {
		if (o.isSubmit == 1) {
			var _this = $(obj);
			if (clt_moblie.length > 0) {
				var m = clt_moblie.val();
				if (m.length != 11 || !rex_mobile.test(m)) {
					o.jalert("璇疯緭鍏ユ湁鏁堢殑鎵嬫満鍙风爜锛�11浣嶆暟锛�", clt_moblie)
				} else {
					glb.ajax(_smsUrl, "JSON", "mobile=" + m + "&typeid=" + typeid + "&uid=" + uid, function() {
						o.isSubmit = 0;
						_this.addClass("off")
					}, function(data) {
						var d = eval(data);
						if (d.status == 1) {
							$.jsuccess("鍙戦€佹垚鍔�", "auto", function() {
								clt_code.focus()
							}, null);
							var _time = 120;
							var _interval = null;
							var _oldTxt = _this.html();
							_this.html("<i>" + _time + "</i>绉掑悗閲嶆柊鑾峰彇");
							var n = _this.find("i");
							n.text(_time--);
							_interval = setInterval(function() {
								n.text(_time--);
								if (_time < -1) {
									if (_interval != null) {
										clearInterval(_interval)
									}
									_this.html(_oldTxt);
									_this.removeClass("off");
									o.isSubmit = 1
								}
							}, 1000)
						} else {
							_this.removeClass("off");
							o.isSubmit = 1;
							if (d.status == 2) {
								o.jalert("鍙戦€侀鐜囧お蹇簡", null)
							} else {
								if (d.status == 3) {
									o.jalert("浠婃棩鍙戦€佺殑鐭俊宸茶揪涓婇檺", null)
								} else {
									if (d.status == 4) {
										o.jalert("璇疯緭鍏ユ湁鏁堢殑鎵嬫満鍙�", clt_moblie)
									} else {
										if (d.status == 5) {
											o.jalert(typeid == 3 ? "璇ユ墜鏈哄彿涓嶈兘缁戝畾" : "璇ユ墜鏈哄彿涓嶈兘鎻愰棶", clt_moblie)
										} else {
											if (d.status == 6 || d.status == 12) {
												o.jalert("鎮ㄥ彂閫佸お棰戠箒浜�", clt_moblie)
											} else {
												if (d.status == 7) {
													o.jalert("璇ユ墜鏈哄彿宸茶绂佺敤", clt_moblie)
												} else {
													if (d.status == 8) {
														o.jalert("璇ユ墜鏈哄彿宸插浜庤处鍙风粦瀹氱姸鎬佷簡", clt_moblie)
													} else {
														if (d.status == 9 || d.status == 11) {
															o.jalert("鎵句笉鍒拌鎵嬫満鍙风粦瀹氱殑璐﹀彿", null)
														} else {
															if (d.status == 10) {
																o.jalert("璇ユ墜鏈哄彿宸茶娉ㄥ唽锛佹偍鍙互浣跨敤璇ユ墜鏈哄彿<a href='/reg/login.html'>鐩存帴鐧诲綍</a>锛屾垨鏇存崲鎵嬫満鍙枫€�", null)
															} else {
																o.jalert("鎿嶄綔澶辫触,璇烽噸鏂板皾璇�", null)
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}, function() {
						_this.removeClass("off");
						o.isSubmit = 1;
						o.jalert("鎿嶄綔澶辫触,璇烽噸鏂板皾璇�", null)
					})
				}
			}
		}
	};
	this.jalert = function(info, obj) {
		$.jalerttimer("鎿嶄綔鎻愮ず", info + "<br /><br />", 550, function() {
			if (obj != null) {
				$(obj).focus()
			}
		}, 9)
	};
	this.isExitsVariable = function(variableName) {
		try {
			if (typeof(variableName) == "undefined") {
				return false
			} else {
				return true
			}
		} catch (e) {}
		return false
	}
};
